The invention relates to a device for operating a movable part of a motor vehicle, in particular a sliding roof, provided with an electric motor for driving the movable part, an adjusting element for setting a desired position for the movable part, an incremental position sensor for detecting the actual position of the sliding roof, a counter in addition to the position sensor, the reading of which counter gives the actual position of the movable part, and an electronic control unit which, depending on the desired position and the counter reading, actuates the electric motor in order to move the movable part into the desired position.
A device of this type is disclosed in DE-A-38 29 405. With a device of this type, errors in counting can cause the reading of the counter to differ from the actual position of the movable part, as a result of which the control unit would no longer be able to move the movable part into the desired position. In the case of said known device, this problem is overcome by adding an additional signal transmitter, which transmits a signal to the control unit when a predetermined position has been reached, with which arrangement a mechanical coupling between the position sensor and the additional signal transmitter fixes the mutual positions of said two elements. However, the costs of the known device are increased by the addition of an additional signal transmitter. Moreover, with said known device the electric motor must be accurately coupled to the movable part or the position sensor and the additional signal transmitter in order to guarantee correct control of the movable part.